<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  layout:decorator="layouts/layout" th:with="header='库存明细', subtext='管理系统中库存明细数据'" style="overflow: hidden;">

<head>
  <title>库存</title>
</head>
<body style="overflow: hidden;">

  <th:block layout:fragment="content">
    <div id="query-area" class="box-body m-b-sm border-bottom">
      <form class="form-horizontal search-form" role="form">
        <div class="row">

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">容器编码</label>
                    <div class="col-sm-9">
                        <input type="text" id="containnum" name="containnum" placeholder="输入容器编码搜索" class="form-control" />
                    </div>
                </div>
            </div>

          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">物料编码</label>
              <div class="col-sm-9">
                <input type="text" id="material" name="material" placeholder="输入物料编码或名称搜索" class="form-control" />
              </div>
            </div>
          </div>

	      <div class="col-sm-3">
	            <div class="form-group">
	              <label class="control-label col-sm-3">物料WBS</label>
	              <div class="col-sm-9">
	                <input type="text" id="lotnum" name="lotnum" placeholder="输入批号搜索" class="form-control" />
	              </div>
	            </div>
	      </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">来源</label>
                    <div class="col-sm-9">

                        <select name="reservecode" id="reservecode" class="form-control">
                            <option value="">请选择</option>
                            <option value="PO">外购物料入库</option>
                            <option value="SM">自制物料入库</option>
                            <option value="OT">其他物料入库</option>
                        </select>
                    </div>
                </div>
            </div>


          <div class="col-sm-3">
            <div class="form-group">
              <label class="control-label col-sm-3">库位</label>
              <div class="col-sm-9">
                <input type="text" id="loccode" name="loccode" placeholder="输入库位编码搜索" class="form-control" />
              </div>
            </div>
          </div>

            <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label col-sm-3">状态</label>
                    <div class="col-sm-9">
                        <input type="text" id="status" name="status" placeholder="输入状态搜索" class="form-control" />
                    </div>
                </div>
            </div>

      </div>
              <div class="row">
                  <!--
                        <div class="col-sm-3">
                            <div class="form-group">
                              <label class="control-label col-sm-3">箱码</label>
                              <div class="col-sm-9">
                                <input type="text" id="tracenum" name="tracenum" placeholder="输入箱码搜索" class="form-control" />
                              </div>
                            </div>
                        </div>
                -->



             </div>
                <div class="row m-t">
                  <div class="col-lg-12 seach-button">
                    <div class="pull-right">
                      <button type="submit" id="search" class="btn btn-primary">
                        <i class="fa fa-search"></i> 搜索
                      </button>
                      <button type="reset" id="clear" class="btn btn-danger">
                        <i class="fa fa-remove"></i> 清除
                      </button>
                    </div>
                  </div>
                </div>
              </form>
            </div>

            <div class="row">
              <div class="col-lg-12">
                <div class="box">
                  <div class="box-body">
                    <h2>
                      <!--
                      <a  class="btn btn-primary btn-sm" th:href="@{|${baseUrl}/add|}" th:title="手动添加库存">
                        <i class="fa fa-fw fa-plus"></i> 添加
                      </a>
                      <a  class="btn btn-primary btn-sm" th:href="@{|${baseUrl}/hold|}" th:title="冻结库存">
                        <i class="fa fa-fw fa-plus"></i> 冻结
                      </a>
                       -->
              <a  class="btn btn-info btn-sm changelocreqAll" href="javascript:;" th:if="${@sec.authorized('__|${baseUrl}/changeloc|__')}" th:title="库位变更">
                <i class="fa fa-fw fa-tasks"></i> 库位变更
              </a>
              <a  class="btn btn-success btn-sm movereqAll" href="javascript:;" th:if="${@sec.authorized('__|${baseUrl}/move|__')}" th:title="移动库存">
                <i class="fa fa-fw fa-tasks"></i> 移动
              </a>
              <a  class="btn btn-warning btn-sm" th:href="@{|${baseUrl}/count|}" th:if="${@sec.authorized('__|${baseUrl}/count|__')}" th:title="生成盘点单">
                <i class="fa fa-fw fa-plus"></i> 盘点
              </a>

                      <button type="button" class="btn btn-primary btn-sm pickstationAll">
                        <i class="fa fa-download"></i> 下架
                      </button>
                        <!--
                      <a  class="btn btn-primary btn-sm posttoerpAll" href="javascript:;" th:title="同步分配信息至WMS">
                          <i class="fa fa-fw fa-plus"></i> 同步至WMS
                      </a>
                       -->

                    <a  class="btn btn-danger btn-sm delAll" href="javascript:;" th:if="${@sec.authorized('__|${baseUrl}/del|__')}" th:title="删除库存">
                      <i class="fa fa-fw fa-trash"></i> 删除
                    </a>
                    <!--
                    <a  class="btn btn-danger btn-sm delmovereqAll" href="javascript:;" th:if="${@sec.authorized('__|${baseUrl}/delmove|__')}" th:title="删除库存并下架">
                      <i class="fa fa-fw fa-trash"></i> 销库下架
                    </a>
                    -->
              <div class="pull-right">
                <a class="btn btn-info" th:title="导入数据" th:href="@{|${baseUrl}/import|}">
                  <i class="fa fa-fw fa-cloud-upload"></i> 导入数据
                </a>
                <a class="btn btn-info export" th:title="导出数据">
                  <i class="fa fa-fw fa-cloud-upload"></i> 导出数据
                </a>
              </div>
            </h2>
            <div id="tableWrapper">
              <table id="table" class="table table-striped table-hover table-bordered table-fixed">
                <thead style="position:sticky;top:0;z-index:10;">
                <tr>
                  <th style="width:50px;">
                    <a href="javascript:;" class="selectAll" title="全选">全选</a>
                  </th>

                    <th style="width:120px;">来源</th>
                    <th style="width:100px;">物料编号</th>
                    <th style="width:160px;">物料描述</th>
                    <th style="width:100px;">WBS</th>
                    <th style="width:75px;">容器条码</th>
                    <th style="width:60px;">数量</th>
                    <th style="width:60px;">已分配</th>
                    <th style="width:60px;">单位</th>
                    <th style="width:80px;">供应商</th>
                    <th style="width:120px;">库位</th>
                    <th style="width:60px;">货权</th>
                    <th style="width:100px;">WMS批</th>
                    <th style="width:150px;">收货时间</th>
<!--                    <th style="width:50px;">质检</th>-->
                    <th style="width:70px;">状态</th>
                    <th style="width:80px;">操作</th>

                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
    <form id="delForm" method="post" style="display: none" th:action="@{|${baseUrl}/v2/del|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="changelocreqForm" method="post" style="display: none" th:action="@{|${baseUrl}/changelocreq|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="movereqForm" method="post" style="display: none" th:action="@{|${baseUrl}/movereq|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="delmovereqForm" method="post" style="display: none" th:action="@{|${baseUrl}/delmovereq|}">
      <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="posttoerpForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/posttoerp|}">
        <input id="ids" type="hidden" name="ids" />
    </form>

    <form id="exportForm" method="post" style="display: none" th:action="@{|${baseUrl}/ca/export|}">
    </form>


    <div class="modal fade" id="myModal" tabindex="-1">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title">拣选口选中</h4>
          </div>
          <div class="modal-body">
            <form id="pickstationForm" method="post" th:action="@{|${baseUrl}/ca/moveout|}">
              <input id="ids" type="hidden" name="ids"/>
              <div class="row">

                <div class="col-md-6">
                  <div>
                    <input type="checkbox" name="pickstations-x-allbox" id="pickstations-x-allbox" value="">
                    <label for="pickstations-x-allbox"><font size="16" color="aqua">库西区</font></label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA1023" id="pickstation-x1">
                    <label for="pickstation-x1">拣选口1</label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA1028" id="pickstation-x2">
                    <label for="pickstation-x2">拣选口2</label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA1033" id="pickstation-x3">
                    <label for="pickstation-x3">拣选口3</label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA1038" id="pickstation-x4">
                    <label for="pickstation-x4">拣选口4</label>
                  </div>
                </div>

                <div class="col-md-6">
                  <div>
                    <input type="checkbox" name="pickstations-d-allbox" id="pickstations-d-allbox" value="">
                    <label for="pickstations-d-allbox"><font size="16" color="aqua">库东区</font></label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA2023" id="pickstation-d1">
                    <label for="pickstation-d1">拣选口1</label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA2028" id="pickstation-d2">
                    <label for="pickstation-d2">拣选口2</label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA2033" id="pickstation-d3">
                    <label for="pickstation-d3">拣选口3</label>
                  </div>
                  <div>
                    <input type="checkbox" name="pickstations" value="PA2038" id="pickstation-d4">
                    <label for="pickstation-d4">拣选口4</label>
                  </div>
                </div>


              </div>

            </form>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            <button type="button" class="btn btn-primary" id="pickstation-btn">确定</button>
          </div>
        </div>
      </div>
    </div>



  </th:block>
  <th:block layout:fragment="scripts">
    <script th:src="@{|${theme}/js/app/inventory/invdetails_list.js?v=${applicationVersion}|}" th:inline="javascript"></script>
  </th:block>
</body>

</html>
